% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/state_from_sitetable.R
\name{state_from_sitetable}
\alias{state_from_sitetable}
\title{state_from_sitetable - Identify US State that each site is in (given ST, FIPS, or lat/lon)}
\usage{
state_from_sitetable(sites, ignorelatlon = FALSE)
}
\arguments{
\item{sites}{data.frame or data.table, with one row per site, and
column(s) that are either "ST" (2-letter abbreviation of State),
"lat" and "lon", or "fips" or "bgfips"
and optionally a column like  "ejam_uniq_id" or "n"}

\item{ignorelatlon}{set to TRUE to skip the slowest step of inferring ST from latlon
in case you want to do that via sites2blocks info on blocks nearby}
}
\value{
the input table as a data.frame, but with these
new columns if ST was not already a column:
ejam_uniq_id, ST, statename, FIPS.ST, REGION, n
}
\description{
Identify US State that each site is in (given ST, lat/lon, or FIPS)
}
\examples{
  state_from_sitetable(testpoints_10)
  state_from_sitetable(testoutput_ejamit_10pts_1miles$results_bysite[, .(ejam_uniq_id, ST, pop)])
  state_from_sitetable(testoutput_ejamit_10pts_1miles$results_bysite[, .(ST, pop)])
  state_from_sitetable(testoutput_ejamit_10pts_1miles$results_bysite[, .(ST, lat, lon, pop)])
  
}
\seealso{
\code{\link[=state_from_blockid_table]{state_from_blockid_table()}} \code{\link[=state_per_site_for_doaggregate]{state_per_site_for_doaggregate()}}
\code{\link[=state_from_latlon]{state_from_latlon()}} \code{\link[=state_from_fips_bybg]{state_from_fips_bybg()}}
}
